<html> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
<body style="font-family:monospace;font-size:12px">
Game of Life<br/>
<script>
X=10;Y=40;M=[L=X*Y];C=[A=0,1,1,2,1,2,2,3];
function f(){
	for(i=j=0,t="<pre>";i<Y*X;j+=++i%X==0){
		k=i+X+3+j*2+A;v=[];
		for(l=-1;l<2;l++)
			v[l+1]=(M[(m=k+l*(X+2))-1]&1)<<18|M[m]<<2|(M[m+1]>>14)&2;
		for(n="",u=r=0;u<16;n=(q?"0":".")+n,u++)
			r|=(q=((z=C[(v[0]>>=1)&7]+C[(v[1]>>=1)&7]+C[(v[2]>>=1)&7]-(s=v[1]>>1&1))==3)+(z==2)*s)<<u;
		M[k+L-A*2]=r;
		t+=n+(i%X==X-1?"\n":"")
	}
	document.body.innerHTML=t;
	A=L-A;
	setTimeout("f()",1)
}
for(i=0;i<L;i++)
	M[i]=(i<X|i%X==0|i%X==X-1|i>(Y-1)*X)?0:Math.random()*65535;
X-=2;Y-=2;
f()
</script> 
</body> 
</html> 